package cn.wwk.notification.search.doc;

import cn.wwk.notification.common.domain.Location;
import cn.wwk.notification.common.domain.User;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * elk中的 user 文档
 * @author wwk
 */
@Data
@NoArgsConstructor
public class UserDoc {

    private Integer id;
    private String name;
    private String phone;

    private String address;
    private String card;
    private String status;
    private String location;
    private Integer cid;

    public UserDoc(User user, Location location){
        this.id = user.getId();
        this.name = user.getName();
        this.phone = user.getPhone();
        this.card = user.getCard();
        this.status = user.getStatus();
        this.address = location.getName();
        this.location = location.getLatitude() + ", " + location.getLongitude();
        this.cid=user.getCid();
    }

    @Override
    public String toString() {
        return "UserDoc{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", card='" + card + '\'' +
                ", status='" + status + '\'' +
                ", location='" + location + '\'' +
                ", cid=" + cid +
                '}';
    }
}
